{extend name="layout/base" /}

{block name="style"}
<style type="text/css">

</style>
{/block}

{block name="body"}
<div class="wrapper wrapper-content">

<div class="row animated fadeIn">
    <div class="col-xs-12">

        <div class="ibox box-success">
            <div class="ibox-title">
                <h5>为<span class="text-danger">{$data.username}</span>设置管理组</h5>
            </div>
            <div class="panel-body ibox-content mainbox">
                <form action="" method="post">
                    <table class="table table-striped table-bordered">
                        <tr>
                            <td width="20%">管理组：</td>
                            <td style="background:#FFFFFF;">
                                {foreach $groups as $v}
                                <label class="ilabel">
                                    <input type="checkbox" class="i-checks" name="group_ids[]" value="{$v['id']}"
                                           {if in_array($v['id'], $data['groups'])} checked="checked"{/if}
                                    />{$v.name}
                                </label>&nbsp;
                                {/foreach}
                            </td>
                        </tr>
                        <tr>
                            <td></td>
                            <td>
                                <input type="hidden" name="rid" value="{$data.id}" />
                                <input type="submit" value="确定" class="btn btn-primary"/>
                            </td>
                        </tr>
                    </table>
                </form>
            </div><!--panel-body-->
        </div><!--ibox-->

    </div><!--col-md-->
</div>

</div><!--wrapper-->
{/block}

{block name="script"}
<!--公共JS-->
{include file="common/commjs" /}
<script type="text/javascript">
    $(function () {
        // 复选框按钮样式
        $('.i-checks').iCheck({
            checkboxClass: 'icheckbox_square-green',
            radioClass: 'iradio_square-green'
        });
    });
</script>
{/block}